package com.ruoyi.web.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.web.domain.entity.Student;
import com.ruoyi.web.mapper.StudentMapper;
import com.ruoyi.web.service.teacher.topicInfo.StudentService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 学生表(StudentTable)表服务实现类
 *
 * @author makejava
 * @since 2022-10-29 16:33:22
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {



    @Override
    public R getStduentTopicList(Long pageNum, Long pageSize) {

        //封装分页条件
        Page<Student> page = new Page<>(pageNum, pageSize);

        //查询学生列表
        List<Student> students = page.getRecords();

        //获取学生id列表
        List<Long> stuIds = students.stream()
                .map(student -> student.getId())
                .collect(Collectors.toList());

        //根据学生id查课题信息
//        stuIds.stream()
//                .forEach(stuid->getById());
        return null;
    }
}

